#define _CRT_SECURE_NO_WARNINGS 1
#include <climits>
class Solution {
public:
    using pii = pair<int, int>;
    vector<string> findRelativeRanks(vector<int>& score)
    {
        int n = score.size();
        vector<string> ret(n);
        vector<pii> v;
        for (int i = 0;i < n;++i)
        {
            v.push_back(make_pair(score[i], i));
        }
        sort(v.rbegin(), v.rend());
        for (int i = 0;i < n;++i)
        {
            if (i == 0)
            {
                ret[v[i].second] = "Gold Medal";
            }
            else if (i == 1)
            {
                ret[v[i].second] = "Silver Medal";
            }
            else if (i == 2)
            {
                ret[v[i].second] = "Bronze Medal";
            }
            else
            {
                ret[v[i].second] = to_string(i + 1);
            }
        }
        return ret;
    }
};